package com.als.healthymananger.controller;


import com.als.healthymananger.entity.JurisdictionGroup;
import com.als.healthymananger.utils.RespBean;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

@Tag(name = "系统管理-权限设置")
public interface JurisdictionGroupApi {
    /**
     * 添加权限
     */
    @PostMapping("/{userType}/{jurisdictionId}")
    @Operation(summary = "添加权限", description = "添加权限", security = @SecurityRequirement(name = "bearer-key"))
    @Parameters({
            @Parameter(name = "userType", description = "角色类型", in = ParameterIn.PATH, required = true),
            @Parameter(name = "jurisdictionId", description = "权限序列", in = ParameterIn.PATH, required = true)
    })
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "添加成功"),
            @ApiResponse(responseCode = "400", description = "添加失败")
    })
    public RespBean createJurisdictionGroups(@PathVariable("userType")String userType,
                                             @PathVariable("jurisdictionId")int jurisdictionId);

    /**
     * 删除权限
     */
    @DeleteMapping("/{userType}/{jurisdictionId}")
    @Operation(summary = "删除权限", description = "删除权限", security = @SecurityRequirement(name = "bearer-key"))
    @Parameters({
            @Parameter(name = "userType", description = "角色类型", in = ParameterIn.PATH, required = true),
            @Parameter(name = "jurisdictionId", description = "权限序列", in = ParameterIn.PATH, required = true)
    })
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "删除成功"),
            @ApiResponse(responseCode = "400", description = "删除失败")
    })
    public RespBean deleteJurisdictionGroups(@PathVariable("userType")String userType,
                                             @PathVariable("jurisdictionId")int jurisdictionId);

    /**
     * 获取角色权限信息
     */
    @GetMapping("/jurisdictions/{userType}")
    @Operation(summary = "获取权限信息", description = "获取角色权限信息", security = @SecurityRequirement(name = "bearer-key"))
    @Parameter(name = "userType", description = "角色类型", in = ParameterIn.PATH, required = true)
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "获取成功"),
            @ApiResponse(responseCode = "400", description = "获取失败")
    })
    public RespBean getUserType(@PathVariable("userType")String userType);

    /**
     * 获取所有权限信息
     */
    @GetMapping("/jurisdictions")
    @Operation(summary = "获取所有权限信息", description = "获取所有权限信息", security = @SecurityRequirement(name = "bearer-key"))
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "获取成功"),
            @ApiResponse(responseCode = "400", description = "获取失败")
    })
    public RespBean getJurisdictions();

    /**
     * 通过权限序列获取权限信息
     * @return
     */
    @GetMapping("/{jurisdictionId}")
    @Operation(summary = "获取权限信息", description = "通过权限序列获取权限信息", security = @SecurityRequirement(name = "bearer-key"))
    @Parameters({
            @Parameter(name = "jurisdictionId", description = "权限序列", in = ParameterIn.PATH, required = true)
    })
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "获取成功"),
            @ApiResponse(responseCode = "400", description = "获取失败")
    })
    public RespBean getJurisdiction(@PathVariable("jurisdictionId")int jurisdictionId);
}
